const route = [
    {
        path: "/admin",
        component: AdminPanel,
        //路由独享守卫
        beforeEnter:(to,from,next)=>{
            //权限验证
            if(!admin()){
                next('/login?redirect=/admin')  //重定向
            }
            else{
                next()
            }
        },
        meta: {requireAuth: true}
    }
]